#[doc = "Register `LSADC_CTRL11` reader"]
pub struct R(crate::R<LSADC_CTRL11_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<LSADC_CTRL11_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<LSADC_CTRL11_SPEC>> for R {
    fn from(reader: crate::R<LSADC_CTRL11_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "ADC power-down control.\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum POWER_DOWN_A {
    #[doc = "0: Working normally."]
    WORKING = 0,
    #[doc = "1: Powered down."]
    POWERED_DOWN = 1,
}
impl From<POWER_DOWN_A> for bool {
    #[inline(always)]
    fn from(variant: POWER_DOWN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `power_down` reader - ADC power-down control."]
pub struct POWER_DOWN_R(crate::FieldReader<bool, POWER_DOWN_A>);
impl POWER_DOWN_R {
    pub(crate) fn new(bits: bool) -> Self {
        POWER_DOWN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> POWER_DOWN_A {
        match self.bits {
            false => POWER_DOWN_A::WORKING,
            true => POWER_DOWN_A::POWERED_DOWN,
        }
    }
    #[doc = "Checks if the value of the field is `WORKING`"]
    #[inline(always)]
    pub fn is_working(&self) -> bool {
        **self == POWER_DOWN_A::WORKING
    }
    #[doc = "Checks if the value of the field is `POWERED_DOWN`"]
    #[inline(always)]
    pub fn is_powered_down(&self) -> bool {
        **self == POWER_DOWN_A::POWERED_DOWN
    }
}
impl core::ops::Deref for POWER_DOWN_R {
    type Target = crate::FieldReader<bool, POWER_DOWN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bit 0 - ADC power-down control."]
    #[inline(always)]
    pub fn power_down(&self) -> POWER_DOWN_R {
        POWER_DOWN_R::new((self.bits & 0x01) != 0)
    }
}
#[doc = "LSADC_CTRL11 is the ADC power-off control register.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lsadc_ctrl11](index.html) module"]
pub struct LSADC_CTRL11_SPEC;
impl crate::RegisterSpec for LSADC_CTRL11_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [lsadc_ctrl11::R](R) reader structure"]
impl crate::Readable for LSADC_CTRL11_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets LSADC_CTRL11 to value 0x01"]
impl crate::Resettable for LSADC_CTRL11_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0x01
    }
}
